# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
#             Mike Brown <mbrown@archlinuxarm.org>
# OMAP FrameBuffer driver for Xorg

buildarch=4

pkgname="xf86-video-omap"
pkgver=0.4.5
pkgrel=3
pkgdesc="OMAP3+ framebuffer driver for X"
arch=('armv7h')
license=('GPL2')
url="http://cgit.freedesktop.org/xorg/driver/xf86-video-omap/"
makedepends=('xorg-server-devel' 'X-ABI-VIDEODRV_VERSION=24.0')
conflicts=('xorg-server<1.20' 'X-ABI-VIDEODRV_VERSION<24' 'X-ABI-VIDEODRV_VERSION>=25')
source=("http://cgit.freedesktop.org/xorg/driver/xf86-video-omap/snapshot/xf86-video-omap-${pkgver}.tar.gz")
sha256sums=('a1c9d396892ac72b9b2d97ae75fba602786aaf4a5fbfb81b048476be52cd5dbf')

build() {
  cd xf86-video-omap-${pkgver}

  # Since pacman 5.0.2-2, hardened flags are now enabled in makepkg.conf
  # With them, module fail to load with undefined symbol.
  # See https://bugs.archlinux.org/task/55102 / https://bugs.archlinux.org/task/54845
  export CFLAGS=${CFLAGS/-fno-plt}
  export CXXFLAGS=${CXXFLAGS/-fno-plt}
  export LDFLAGS=${LDFLAGS/,-z,now}

  ./autogen.sh
  ./configure --prefix=/usr

  make
}

package() {
  cd xf86-video-omap-${pkgver}

  make DESTDIR="${pkgdir}" install
}
